import css from './store.css'
import edit from  './component/edit';
import {Vue,axios,navigation,commonVue,loadsection} from '../../assets/js/base.js';
import SYS_Store_sel from  '../../API/SYS_Store_sel.js';

new Vue({
    el: '#main',
    data:{
      fullScreen:false,//是否全屏
      currentMenu:"store.html",//当前菜单
      tableLoading:false,
      pageState:false,
      search_data:{
        pageNo:1,
        pageSize:10
      },
      editSettingDialog:false,
      loadSection:false,
      table_data:[],
      currentData:null
    },
    mounted:function(){
      this.search();
    },
    methods:{
      globalEvent:function(){
        commonVue.$emit('navSelected');
      },
      confirmEditSettingDialog(){
        this.editSettingDialog = false;
        this.getTableData();
      },
      openEditSettingDialog(item){
        this.currentData = item;
        this.editSettingDialog = true;
      },
      cancelEditSettingDialog(){
        this.editSettingDialog = false;
      },
      checkPermission(){
        return true;
      },
      getTableData(){
        this.tableLoading = true;
        SYS_Store_sel(this.search_data).then((data) => {
          this.table_data = [].concat(data);
          this.tableLoading = false;
        }).catch(message => {
          this.tableLoading = false;
          this.$Message({
              message
          });
          console.log("SYS_Store_sel异常:",message)
        });
      },
      search() {
          this.search_data.pageNo = 1;
          this.getTableData();
      },
    },
    components: {
      navigation,
      loadsection,
      'edit':edit,
    }
})
